﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcProject.Models.Team>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Edit
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        编辑班组</h2>
    <% using (Html.BeginForm())
       {%>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <legend>班组信息</legend>
        <div class="editor-label">
            所属项目名称
        </div>
        <div class="editor-label">
            <%: Html.DropDownList("projectId", ViewData["projectinfos"] as SelectList)%>
        </div>
        <div class="editor-label">
            班组名称
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.TeamName) %>
            <%: Html.ValidationMessageFor(model => model.TeamName) %>
        </div>
        <div class="editor-label">
            班组排序号
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.TeamOrder) %>
            <%: Html.ValidationMessageFor(model => model.TeamOrder) %>
        </div>
        <div class="editor-label">
            班组负责人
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.TeamLeader) %>
            <%: Html.ValidationMessageFor(model => model.TeamLeader) %>
        </div>
        <div class="editor-label">
            班级负责人身份证号
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.TeamLeaderCardId) %>
            <%: Html.ValidationMessageFor(model => model.TeamLeaderCardId) %>
        </div>
        <div>
            <%: Html.ActionLink("增加班组合同", "../ContractInfo/Create", new { foreignerId = Model.TeamId, type = (int)MvcProject.Utils.ContractType.Team }, new { target = "_blank" })%>
            <table>
                <tr>
                    <th>
                        合同类型
                    </th>
                    <th>
                        合同名称
                    </th>
                    <th>
                        合同开始时间
                    </th>
                    <th>
                        合同结束时间
                    </th>
                    <th>
                        合同金额
                    </th>
                    <th>
                        创建人
                    </th>
                    <th>
                        创建时间
                    </th>
                    <th>
                    </th>
                </tr>
                <%
                    IEnumerable<MvcProject.Models.ContractInfo> ContractInfos = (IEnumerable<MvcProject.Models.ContractInfo>)ViewData["ContractInfos"];
                    if (ContractInfos != null) foreach (var item in ContractInfos)
                        { %>
                <tr>
                    <td>
                        <%: item.ContractType == 1 ? "项目合同" : "人员合同"%>
                    </td>
                    <td>
                        <%: item.ContractName %>
                    </td>
                    <td>
                        <%: String.Format("{0:g}", item.ContractStartDate) %>
                    </td>
                    <td>
                        <%: String.Format("{0:g}", item.ContractEndDate) %>
                    </td>
                    <td>
                        <%: item.ContractMoney %>
                    </td>
                    <td>
                        <%: item.CreateUserName %>
                    </td>
                    <td>
                        <%: String.Format("{0:g}", item.CreateDate) %>
                    </td>
                    <td>
                        <%: Html.ActionLink("编辑", "../ContractInfo/Edit", new { id = item.ContractId },new {target="_blank"})%>
                        |
                        <%: Html.ActionLink("详细信息", "../ContractInfo/Details", new { id = item.ContractId, teamId = Model.TeamId }, new { target = "_blank" })%>
                        |
                        <%: Html.ActionLink("删除", "../ContractInfo/Delete", new { id = item.ContractId }, new { target = "_blank" })%>
                    </td>
                </tr>
                <% } %>
            </table>
        </div>
        <p>
            <input type="submit" value="保存" />
        </p>
    </fieldset>
    <% } %>
    <div>
        <%: Html.ActionLink("返回", "Index") %>
    </div>
</asp:Content>
